var url = 'index.jsp?inc=./score/';
function general() // 게시판에서 사용하는 공통 모듈
{
	if(document.getElementById('btnlist') != null)
	{
		document.getElementById('btnlist').onclick=function()
		{
			var frm = document.hiddenfrm;
			frm.action = url+'list.jsp';
			frm.submit();
		}
	}
	if(document.getElementById('btninput') != null)
	{
		document.getElementById('btninput').onclick=function()
		{
			var frm = document.hiddenfrm;
			frm.action = url+'input.jsp';
			frm.submit();
		}
	}
	if(document.getElementById('btnmodify') != null)
	{
		document.getElementById('btnmodify').onclick=function()
		{
			location.href=url+'modify.jsp'
		}
	}
	if(document.getElementById('btndelete') != null)
	{
		document.getElementById('btndelete').onclick=function()
		{
			var b = confirm("진짜 지움?");
			if(b)
			{
				var rno = document.hiddenfrm.rno.value;
				location.href=url+'delete_result.jsp&rno='+rno;
			}
			else
			{
				alert("취솤");
			}
		}
	}
	if(document.getElementById('btnview') != null)
	{
		document.getElementById('btnview').onclick=function()
		{
			location.href=url+'view.jsp'
		}
	}
}

function goPage(page)
{
	var mf = document.hiddenfrm;
	mf.nowpage.value = page;
	mf.find.value = document.score_list_frm.find.value;
	mf.action = 'index.jsp?inc=./score/list.jsp';
	mf.submit();
}
function goView(page, rno)
{
	var mf = document.hiddenfrm;
	mf.nowpage.value = page;
	mf.find.value = document.score_list_frm.find.value;
	mf.action = 'index.jsp?inc=./score/view.jsp&rno='+rno;
	mf.submit();
}
function inputInit() // input과 관련된 모듈
{
	general();
	document.getElementById('btnSave').onclick=function()
	{
		var f = document.frminput;
		if(!f.mid.value)
		{
			alert('아이디 입력해.');
			f.mid.focus();
		}
		else
		{
			f.submit();
		}
	}
}
function input_resultInit()
{
	general();
}
function listInit()
{
	general();
}
function viewInit()
{
	general();
}
function deleteInit()
{
	general();
}
function modifyInit()
{
	general();
	document.getElementById('btnSave').onclick=function()
	{
		var f = document.frm;
		if(!f.mid.value)
		{
			alert('아이디 입력해.');
			f.mid.focus();
		}
		else
		{
			f.submit();
		}
	}
}